import {createRouter,createWebHashHistory} from 'vue-router'
// 1. 定义路由组件.
// 也可以从其他文件导入

 import Login from '../components/Login.vue'
 import main from '../components/main.vue'
 import Check from '../views/Checker.vue'
 import Admin from '../views/Admin.vue'
 import User from '../views/User.vue'
 import Tag from '../views/Tag.vue'
 import Text from '../views/Text.vue'
 import Video from '../views/Video.vue'
 import Music from '../views/Music.vue'
 import Score from '../views/Score.vue'
 import Contents from '../views/Contents.vue'
 import Collect from '../views/Collect.vue'
 import Like from '../views/Like.vue'
 import Total from '../views/Total.vue'
 import ContentsTotal from '../views/ContentsTotal.vue'
 import Checkstatistics from '../views/Checkstatistics.vue'
 import Checkmanage from '../views/Checkmanage.vue'
 import Admincnter from '../views/Admincenter.vue'
 import Welcome from '../views/Welcome.vue'
 import Feedback from '../views/Feedback.vue'
// 2. 定义一些路由
// 每个路由都需要映射到一个组件。
// 我们后面再讨论嵌套路由。
const routes = [
  { path: '/', name:"登录",component: Login },
  { path: '/main',name:"主界面", component: main,children:[
    { path: '/user', name:"用户管理",meta:{power:100},component: User },
    { path: '/admin', name:"管理员管理",meta:{power:100},component: Admin },
    { path: '/tag', name:"标签管理",meta:{power:100},component: Tag },
    { path: '/text', name:"专栏管理",meta:{power:100},component: Text },
    { path: '/video', name:"视频管理",meta:{power:100},component:Video },
    { path: '/music',name:"乐曲管理", meta:{power:100},component: Music },
    { path: '/score', name:"谱管理",meta:{power:100},component: Score },
    { path: '/contents', name:"帖子管理",meta:{power:100},component: Contents},
    { path: '/collect',name:"收藏管理", meta:{power:100},component: Collect },
    { path: '/like',name:"点赞管理", meta:{power:100},component: Like },
    { path: '/total',name:"统计信息", meta:{power:100},component: Total },
    { path: '/contents_total',name:"评论统计信息", meta:{power:100},component: ContentsTotal },
    { path: '/checkstatistics',name:"审核统计", meta:{power:100},component: Checkstatistics},
    { path: '/checkmanage',name:"审核管理", meta:{power:200},component: Checkmanage},
    { path: '/Feedback',name:"申诉管理", meta:{power:200},component: Feedback},
    { path: '/admincenter',name:"管理员中心",component: Admincnter},
    { path: '/welcome',name:"欢迎页面",component: Welcome},
    
  ] },
]

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
})


export default router
// 现在，应用已经启动了！